<template>
  <div>
    <h3>事件修饰符</h3>
    <div class="box" @click="cc">
      <a href="https://www.baidu.com/" @click.stop="aa">百度一下</a><br>
      <a href="https://www.baidu.com/" @click.prevent.stop="aa">禁止跳转</a><br>
    </div> 
    <!-- 按键修饰符 只能给keyup keydown 绑定 -->
  <input type="text" @keydown.enter="bb">
  </div>
</template>

<script>
export default {
  methods:{
    aa(){
      console.log(1122);
    },
    bb(e){
      // 输出输入框的值
      console.log(e.target.value);
    },
    cc(){
      console.log(456);
    }
  }
}
</script>

<style>
  .box{
    width: 200px;
    height: 100px;
    background-color: #666;
  }
</style>